package testClasses.misc;

import galaxies.CustomGalaxyData;
import galaxies.enums.EGalaxyAge;
import galaxies.enums.EGalaxyType;
import galaxies.enums.EQuickZones;
import galaxies.enums.ERandomDial;
import galaxies.enums.ESlowZones;
import gameAppLayer.GameSettings;
import gameAppLayer.XMLData;
import gameAppLayer.ExternalData;

import java.util.ArrayList;

import population.Clade;
import population.EDifficulty;
import population.EEffectsDetails;
import population.EReligionStrength;
import population.EStartingClades;
import population.EStartingReligions;
import population.ETransitSpeed;
import population.FMClade;
import population.FMFlag;
import population.FMGovernment;
import population.FMReligion;
import population.FMStateReligion;
import population.Flag;
import population.Government;
import population.Religion;

//import universe.GameSettings;


/*
 * Quickly sets the values in the GameSettings object, avoiding menus, etc.
 */
public class TestGameSettingsDefaults {
	
	public GameSettings settings;
	public ExternalData externalData;	
	
	public TestGameSettingsDefaults(){
		initSettings();
	}
	
	public TestGameSettingsDefaults(ExternalData externalData) {
		this.externalData = externalData;
		initSettings();
	}
	
	private void initSettings(){
		
		settings = new GameSettings();
		
		ArrayList<String> entries = externalData.getCustomGalaxyList().getEntries();
		
		CustomGalaxyData data = externalData.getCustomGalaxyList().getData("Smile");		

		/*
		 * Universe settings
		 */
		//--------------------------------------------------------
		//Galaxy settings
//		settings.addGalaxy(
//				"GAL1", 
//				EGalaxySize.LARGE, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);
//		settings.addGalaxy(
//				"GAL2", 
//				EGalaxySize.LARGE, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL3", 
//				80000,  //galaxy size (HUGE)
//				EGalaxyType.CUSTOM, 
//				40, 	//galaxy density (MODERATE)
//				EGalaxyAge.AVERAGE, 
//				0.01, //earthlike % (UNCOMMON)
//				data);				
//		
		settings.addGalaxy(
				"GAL4", 
				80000, 
				EGalaxyType.SPIRAL, 
				40, 
				EGalaxyAge.AVERAGE, 
				0.01);		
//		settings.addGalaxy(
//				"GAL5", 
//				EGalaxySize.TINY, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL6", 
//				EGalaxySize.TINY, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL7", 
//				EGalaxySize.TINY, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL8", 
//				EGalaxySize.TINY, 
//				EGalaxyType.ELLIPTICAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL9", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL10", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL11", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL12", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL13", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL14", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL15", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL16", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL18", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL19", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL20", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL21", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL22", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL23", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL24", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL25", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL26", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL27", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);		
//		settings.addGalaxy(
//				"GAL28", 
//				EGalaxySize.MEDIUM, 
//				EGalaxyType.SPIRAL, 
//				EGalaxyDensity.MODERATE, 
//				EGalaxyAge.AVERAGE, 
//				EEarthlike.UNCOMMON);
		
		
		
		//Global settings
		settings.setQuickZone(EQuickZones.UNCOMMON);
		settings.setSlowZone(ESlowZones.UNCOMMON);
		settings.setRandomDial(ERandomDial.AVERAGE);
		settings.setMegaEvents(false);		
		settings.setResearchRate(1.0); //average rate
		//--------------------------------------------------------
		
		
		
		Religion religion = new FMReligion(EStartingReligions.ABRAHAMIC).createReligion();
		/*
		 * Nation setup information
		 */
		//--------------------------------------------------------
		Clade clade = new FMClade(EStartingClades.CYBORGS).createClade();
		settings.setNationClade(clade);
		settings.setNationReligion(religion);		
		settings.setNationReligionStrength(EReligionStrength.WEAK);		
		settings.setNationName("Uber Nation");
		settings.setNationFlag(new FMFlag().createFlag());
		
		
		
		/*
		 * State setup information
		 */
		//--------------------------------------------------------
		settings.setCoreClade(clade);
		settings.addClade(clade);
		settings.addReligion(religion);		
		settings.setStateReligion(new FMStateReligion().createStateReligion(religion));
		settings.setStateName("Uber State");
		settings.setStateFlag(new FMFlag().createFlag());
		settings.setGovernment(new FMGovernment().createGovernment());
		settings.setDifficulty(EDifficulty.AVERAGE);
		//--------------------------------------------------------
		
		
		/*
		 * Additional options (from state setup menu)
		 */
		//--------------------------------------------------------
		settings.setSpyMissions(false);
		settings.setMonoStates(false);
		settings.setNoUnification(false);
		settings.setTransitSpeed(ETransitSpeed.ALL);
		settings.setQuietStart(false);
		settings.setNumArkShips(0); //only accessed if quietStart = true
		settings.setAutoResolveCombats(false);
		settings.setHighlightEnemyMoves(true);
		settings.setHighlightFriendlyMoves(true);		
		//--------------------------------------------------------
		
		
		/*
		 * Options - graphics settings
		 */
		//--------------------------------------------------------
		//Resoultion settings(??)
		settings.setMainEffects(EEffectsDetails.MEDIUM);
		settings.setCombatEffects(EEffectsDetails.MEDIUM);
		settings.setBackgroundStars(true);
		//--------------------------------------------------------
		
		/*
		 * Options - audio settings
		 */
		//--------------------------------------------------------
		settings.setFxVolume(50);
		settings.setMusicVolume(50);
		settings.setInterfaceVolume(50);
		settings.setMasterVolume(50);
		//audio quality settings(??)
		//--------------------------------------------------------
		
		/*
		 * Options - input settings
		 */
		//--------------------------------------------------------
		settings.setMouseSensitivity(50);
		//keybindings list (??)
		//--------------------------------------------------------
		
		
		/*
		 * Options - input - combat settings
		 */
		//--------------------------------------------------------
		//keybindings list (??)
		//--------------------------------------------------------
		
		
		/*
		 * Options - miscellaneous
		 */
		//--------------------------------------------------------
		settings.setShowClock(true);
		settings.setMilClock(false);
		settings.setAlarmOn(false);
		settings.setAlarmHour(0);
		settings.setAlarmMinute(0);
		settings.setAlarmAM(true);
		//--------------------------------------------------------
		
		//return settings;
		
		
		
		
		
		

	}

}
